﻿using System.ComponentModel.DataAnnotations;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Web.Models.VersionData;

namespace Web.ViewModel.VersionData
{
    public class VersionsModel
    {

        public static VersionsModel ConvertModel(Versions versions)
        {
            return new VersionsModel()
            {
                Id = versions.Id,
                CreateTime=versions.CreateTime,
                VersionLibId=versions.VersionLibId,
                UpdateType=versions.UpdateType,
                updateMethod=versions.updateMethod,
                UpdateTime=versions.UpdateTime,
                VersionNumber=versions.VersionNumber,
                UpgradeFilePath=versions.UpgradeFilePath,
                VersionDescription=versions.VersionDescription
            };
        }



        public Guid Id { get; set; }

        /// <summary>
        /// 版本库ID
        /// </summary>
        public String VersionLibId { get; set; }

        /// <summary>
        /// 更新类型 1：自主更新，2：强制更新，3：后台更新
        /// </summary>
        public int UpdateType { get; set; }

        /// <summary>
        /// 更新类型 1：自主更新，2：强制更新，3：后台更新
        /// </summary>
        public int updateMethod { get; set; }

        /// <summary>
        ///  当前版本
        /// </summary>
        public String VersionNumber { get; set; }

        /// <summary>
        ///  更新包路径
        /// </summary>
        public String UpgradeFilePath { get; set; }

        /// <summary>
        ///  版本描述
        /// </summary>
        public String VersionDescription { get; set; }

        /// <summary>
        ///  更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }

        /// <summary>
        ///  创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

    }
}
